Fork of Chiri for Astro for my blog
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at bcd31bfa38a6de9fbb609d7d564d453959a9a365 27 lines 725 B view raw
1--- 2import { type CollectionEntry, getCollection } from 'astro:content' 3import PostLayout from '@/layouts/PostLayout.astro' 4import { render } from 'astro:content' 5 6export async function getStaticPaths() { 7 const posts = await getCollection('posts') 8 return posts 9 .filter((post) => !post.id.startsWith('_')) 10 .map((post) => ({ 11 params: { slug: post.id }, 12 props: post 13 })) 14} 15 16type Props = CollectionEntry<'posts'> 17 18const post = Astro.props 19const { Content, remarkPluginFrontmatter } = await render(post) 20 21const readingTime = remarkPluginFrontmatter.readingTime 22const toc = remarkPluginFrontmatter.toc || [] 23--- 24 25<PostLayout {...post.data} readingTime={readingTime} toc={toc}> 26 <Content /> 27</PostLayout>